package com.yunji.base.enums;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package com.yunji.user.enums
 * @FileName AgentMode.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @version 1.0
 * @since JDK 1.8.0_202
 * @CreateTime 2024-05-28 16:01:48
 * @Description 代理模式枚举
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo0803@163.com	2024-05-28 16:01:48		1.0					1.0 Version
 */
public enum AgentMode {
    AGENT_SUPPORT(0, "合作代理"),
    SELF_SUPPORT(1, "自营代理");

    AgentMode(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    private final Integer code;

    private final String text;

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code) {
        AgentMode[] enums = AgentMode.values();
        for (AgentMode e : enums) {
            if (Objects.equals(e.code, code)) {
                return e.text;
            }
        }
        return null;
    }
}